Optimal. Leaf size=50 \[ \frac{2 b (a+b x) \sin (c+d x)}{d^2}-\frac{(a+b x)^2 \cos (c+d x)}{d}+\frac{2 b^2 \cos (c+d x)}{d^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0424857, antiderivative size = 50, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 14, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.143, Rules used = {3296, 2638} \[ \frac{2 b (a+b x) \sin (c+d x)}{d^2}-\frac{(a+b x)^2 \cos (c+d x)}{d}+\frac{2 b^2 \cos (c+d x)}{d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 3296
Rule 2638
Rubi steps
\begin{align*} \int (a+b x)^2 \sin (c+d x) \, dx &=-\frac{(a+b x)^2 \cos (c+d x)}{d}+\frac{(2 b) \int (a+b x) \cos (c+d x) \, dx}{d}\\ &=-\frac{(a+b x)^2 \cos (c+d x)}{d}+\frac{2 b (a+b x) \sin (c+d x)}{d^2}-\frac{\left (2 b^2\right ) \int \sin (c+d x) \, dx}{d^2}\\ &=\frac{2 b^2 \cos (c+d x)}{d^3}-\frac{(a+b x)^2 \cos (c+d x)}{d}+\frac{2 b (a+b x) \sin (c+d x)}{d^2}\\ \end{align*}
Mathematica [A] time = 0.172425, size = 57, normalized size = 1.14 \[ \frac{2 b d (a+b x) \sin (c+d x)-\left (a^2 d^2+2 a b d^2 x+b^2 \left (d^2 x^2-2\right )\right ) \cos (c+d x)}{d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] time = 0.007, size = 148, normalized size = 3. \begin{align*}{\frac{1}{d} \left ({\frac{{b}^{2} \left ( - \left ( dx+c \right ) ^{2}\cos \left ( dx+c \right ) +2\,\cos \left ( dx+c \right ) +2\, \left ( dx+c \right ) \sin \left ( dx+c \right ) \right ) }{{d}^{2}}}+2\,{\frac{ab \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{d}}-2\,{\frac{{b}^{2}c \left ( \sin \left ( dx+c \right ) - \left ( dx+c \right ) \cos \left ( dx+c \right ) \right ) }{{d}^{2}}}-{a}^{2}\cos \left ( dx+c \right ) +2\,{\frac{abc\cos \left ( dx+c \right ) }{d}}-{\frac{{b}^{2}{c}^{2}\cos \left ( dx+c \right ) }{{d}^{2}}} \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.00775, size = 190, normalized size = 3.8 \begin{align*} -\frac{a^{2} \cos \left (d x + c\right ) + \frac{b^{2} c^{2} \cos \left (d x + c\right )}{d^{2}} - \frac{2 \, a b c \cos \left (d x + c\right )}{d} - \frac{2 \,{\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} b^{2} c}{d^{2}} + \frac{2 \,{\left ({\left (d x + c\right )} \cos \left (d x + c\right ) - \sin \left (d x + c\right )\right )} a b}{d} + \frac{{\left ({\left ({\left (d x + c\right )}^{2} - 2\right )} \cos \left (d x + c\right ) - 2 \,{\left (d x + c\right )} \sin \left (d x + c\right )\right )} b^{2}}{d^{2}}}{d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 1.65042, size = 138, normalized size = 2.76 \begin{align*} -\frac{{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right ) - 2 \,{\left (b^{2} d x + a b d\right )} \sin \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A] time = 0.656389, size = 112, normalized size = 2.24 \begin{align*} \begin{cases} - \frac{a^{2} \cos{\left (c + d x \right )}}{d} - \frac{2 a b x \cos{\left (c + d x \right )}}{d} + \frac{2 a b \sin{\left (c + d x \right )}}{d^{2}} - \frac{b^{2} x^{2} \cos{\left (c + d x \right )}}{d} + \frac{2 b^{2} x \sin{\left (c + d x \right )}}{d^{2}} + \frac{2 b^{2} \cos{\left (c + d x \right )}}{d^{3}} & \text{for}\: d \neq 0 \\\left (a^{2} x + a b x^{2} + \frac{b^{2} x^{3}}{3}\right ) \sin{\left (c \right )} & \text{otherwise} \end{cases} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.1075, size = 88, normalized size = 1.76 \begin{align*} -\frac{{\left (b^{2} d^{2} x^{2} + 2 \, a b d^{2} x + a^{2} d^{2} - 2 \, b^{2}\right )} \cos \left (d x + c\right )}{d^{3}} + \frac{2 \,{\left (b^{2} d x + a b d\right )} \sin \left (d x + c\right )}{d^{3}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]